package handle

import (
	"context"
	"gitee.com/jinmingzhi/cdce-service/pkg/errs"
)

func GetUid(ctx context.Context) (uint32, error) {
	uid, ok := ctx.Value("uid").(uint32)
	if !ok {
		return 0, errs.ErrInvalidContext
	}
	return uid, nil
}
